home *** CD-ROM | disk | FTP | other *** search
- /*
- Text.h
- Application Kit, Release 2.1J
- Copyright (c) 1988, NeXT, Inc. All rights reserved.
- */
-
- #ifndef TEXT_H
- #define TEXT_H
- #import "NSView.h"
- #import "chunk.h"
- #import "color.h"
- #import "NSFontManager.h"
- #import "readOnlyTextStream.h"
- #import "NSSpellChecker.h"
- #import "NXRTFDErrors.h"
-
- #ifdef KANJI
- typedef wchar_t wchar; // Basic character type
- #else KANJI
- typedef unsigned char wchar; // Basic character type
- #endif KANJI
-
- #define NSTextBlockSize 512
-
- typedef struct _NXTextBlock {
- struct _NXTextBlock *next; /* next text block in link list */
- struct _NXTextBlock *prior; /* previous text block in link list */
- struct _tbFlags {
- unsigned int malloced:1; /* true if block was malloced */
- unsigned int PAD:15;
- } tbFlags;
- short chars; /* number of chars in this block */
- wchar *text; /* the text */
- } NSTextBlock;
-
- /*
- * NXRun represents a single run of text w/ a given format
- */
-
- typedef struct {
- unsigned int underline:1;
- unsigned int dummy:1; /* unused */
- unsigned int subclassWantsRTF:1;
- unsigned int graphic:1;
- unsigned int forcedSymbol:1; /* did alt-char force use to use symbol */
- unsigned int RESERVED:11;
- } NSRunFlags;
-
- typedef struct _NXRun {
- id font; /* Font id */
- int chars; /* number of chars in run */
- void *paraStyle; /* implementation dependent paraStyle
- * sheet info. */
- float textGray; /* text gray of current run */
- int textRGBColor; /* text color negative if not set */
- unsigned char superscript;/* superscript in points */
- unsigned char subscript; /* subscript in points */
- id info; /* available for subclasses of Text */
- NSRunFlags rFlags;
- } NSRun;
-
- /*
- * NXRunArray is a NXChunk that holds the set of formats for a Text object
- */
-
- typedef struct _NXRunArray {
- NSTextChunk chunk;
- NSRun runs[1];
- } NSRunArray;
-
- /*
- * NXBreakArray is a NXChunk that holds line break information for a Text
- * Object. it is mostly an array of line descriptors. each line
- * descriptor contains 3 fields:
- *
- * 1) line change bit (sign bit), set if this line defines a new height
- * 2) paragraph end bit (next to sign bit), set if the end of this
- * line ends the paragraph
- * 3) numbers of characters in the line (low order 14 bits)
- *
- * if the line change bit is set, the descriptor is the first field of a
- * NXHeightChange. since this record is bracketed by negative short
- * values, the breaks array can be sequentially accessed backwards and
- * forwards.
- */
-
- #if m68k
- typedef short NSLineDesc;
- #else
- typedef int NSLineDesc;
- #endif
-
- typedef struct _NXHeightInfo {
- float newHeight; /* line height from here forward */
- float oldHeight; /* height before change */
- NSLineDesc lineDesc; /* line descriptor */
- } NSHeightInfo;
-
- typedef struct _NXHeightChange {
- NSLineDesc lineDesc; /* line descriptor */
- NSHeightInfo heightInfo;
- } NSHeightChange;
-
- typedef struct _NXBreakArray {
- NSTextChunk chunk;
- NSLineDesc breaks[1];
- } NSBreakArray;
-
- /*
- * NXLay represents a single run of text in a line and records
- * everything needed to select or draw that piece.
- */
-
- typedef struct {
- unsigned int mustMove:1; /* unimplemented */
- unsigned int isMoveChar:1;
- unsigned int RESERVED:14;
- } NSLayFlags;
-
- typedef struct _NXLay {
- float x; /* x coordinate of moveto */
- float y; /* y coordinate of moveto */
- short offset; /* offset in line array for text */
- short chars; /* number of characters in lay */
- id font; /* font id */
- void *paraStyle; /* implementation dependent fontStyle
- * sheet info. */
- NSRun *run; /* run for lay */
- NSLayFlags lFlags;
- } NSLay;
-
- /*
- * NXLayArray is a NXChunk that holds the layout for the current line
- */
-
- typedef struct _NXLayArray {
- NSTextChunk chunk;
- NSLay lays[1];
- } NSLayArray;
-
- /*
- * NXWidthArray is a NXChunk that holds the widths for the current line
- */
-
- typedef struct _NXWidthArray {
- NSTextChunk chunk;
- float widths[1];
- } NSWidthArray;
-
- /*
- * NXCharArray is a NXChunk that holds the chars for the current line
- */
-
- typedef struct _NXCharArray {
- NSTextChunk chunk;
- wchar text[1];
- } NSCharArray;
-
- /*
- * Word definition Finite State Machine transition struct
- */
- typedef struct _NXFSM {
- const struct _NXFSM *next; /* state to go to, NULL implies final state */
- short delta; /* if final state, this undoes lookahead */
- short token; /* if final state, < 0 word is newline,
- * = is dark, > is white space */
- } NSFSM;
-
- /*
- * Represents one end of a selection
- */
-
- typedef struct _NXSelPt {
- int cp; /* character position */
- int line; /* offset of LineDesc in break table */
- float x; /* x coordinate */
- float y; /* y coordinate */
- int c1st; /* character position of first character
- * on the line */
- float ht; /* line height */
- } NSSelPt;
-
- /*
- * describes tabstop
- */
-
- typedef struct _NXTabStop {
- short kind; /* only NX_LEFTTAB implemented*/
- float x; /* x coordinate for stop */
- } NSTabStop;
-
- typedef struct _NXTextCache {
- int curPos; /* current position in text stream */
- NSRun *curRun; /* cache current block of text and */
- int runFirstPos; /* character pos that corresponds */
- NSTextBlock *curBlock; /* cache current block of text and */
- int blockFirstPos; /* character pos that corresponds */
- } NSTextCache;
-
- typedef struct _NXLayInfo {
- NSRect rect; /* bounds rect for current line. */
- float descent; /* descent for current line, can be reset
- * by scanFunc */
- float width; /* width of line */
- float left; /* left side visible coordinate */
- float right; /* right side visible coordinate */
- float rightIndent; /* how much white space is left at right
- * side of line */
- NSLayArray *lays; /* scanFunc fills with NXLay items */
- NSWidthArray *widths; /* scanFunc fills with character widths */
- NSCharArray *chars; /* scanFunc fills with characters */
- NSTextCache cache; /* cache of current block & run */
- NSRect *textClipRect; /* if non-nil, the current clip for drawing */
- struct _lFlags {
- unsigned int horizCanGrow:1;/* 1 if scanFunc should perform dynamic
- * growing of x margins */
- unsigned int vertCanGrow:1;/* 1 if scanFunc should perform dynamic
- * growing of y margins */
- unsigned int erase:1; /* used to tell drawFunc to erase before
- * drawing line */
- unsigned int ping:1; /* used to tell drawFunc to ping server */
- unsigned int endsParagraph:1;/* true if line ends the paragraph, eg
- * ends in newline */
- unsigned int resetCache:1;/* used in scanFunc to reset local caches */
- unsigned int RESERVED:10;
- } lFlags;
- } NSLayInfo;
-
- /*
- * Gives a paragraph fontStyle
- */
-
- typedef struct _NXTextStyle {
- float indent1st; /* how far first line in paragraph is
- * indented */
- float indent2nd; /* how far second line is indented */
- float lineHt; /* line height */
- float descentLine;/* distance to ascent line from bottom of
- * line */
- short alignment; /* justification */
- short numTabs; /* number of tab stops */
- NSTabStop *tabs; /* array of tab stops */
- } NSTextStyle;
-
- typedef enum _NSTextAlignment {
- NSLeftTextAlignment = 0, /* Visually left aligned */
- NSRightTextAlignment = 1, /* Visually right aligned */
- NSCenterTextAlignment = 2,
- NSJustifiedTextAlignment = 3,
- NSNaturalTextAlignment = 4 /* Indicates the default alignment for script */
- } NSTextAlignment;
-
- /* tab stop fontStyles */
-
- #define NSLefttabKey 0
-
- #define NSBackspaceKey 8
- #define NSCarriageReturnKey 13
- #define NSDeleteKey ((unsigned short)0x7F)
- #define NSBacktabKey 25
-
- /* movement codes for movement between fields */
-
- #define NSIllegalTextMovement 0
- #define NSReturnTextMovement ((unsigned short)0x10)
- #define NSTabTextMovement ((unsigned short)0x11)
- #define NSBacktabTextMovement ((unsigned short)0x12)
- #define NSLeftTextMovement ((unsigned short)0x13)
- #define NSRightTextMovement ((unsigned short)0x14)
- #define NSUpTextMovement ((unsigned short)0x15)
- #define NSDownTextMovement ((unsigned short)0x16)
-
- typedef enum {
- NSLeftAlignedParagraph = NSLeftTextAlignment,
- NSRightAlignedParagraph = NSRightTextAlignment,
- NSCenterAlignedParagraph = NSCenterTextAlignment,
- NSJustificationAlignedParagraph = NSJustifiedTextAlignment,
- NSFirstIndentParagraph,
- NSIndentParagraph,
- NSAddTabParagraph,
- NSRemoveTabParagraph,
- NSLeftMarginParagraph,
- NSRightMarginParagraph
- } NSParagraphProperty;
-
-
- /*
- Word tables for various languages. The SmartLeft and SmartRight arrays
- are suitable as arguments for the messages setPreSelSmartTable: and
- setPostSelSmartTable. When doing a paste, if the character to the left
- (right) of the new word is not in the left (right) table, an extra space
- is added on that side. The CharCats tables define the character classes
- used in the word wrap or click tables. The BreakTables are finite state
- machines that determine word wrapping. The ClickTables are finite state
- machines that determine which characters are selected when the user
- double clicks.
- */
-
- extern const unsigned char * const NSEnglishSmartLeftChars;
- extern const unsigned char * const NSEnglishSmartRightChars;
- extern const unsigned char * const NSEnglishCharCatTable;
- extern const NSFSM * const NSEnglishBreakTable;
- extern const int NSEnglishBreakTableSize;
- extern const NSFSM * const NSEnglishNoBreakTable;
- extern const int NSEnglishNoBreakTableSize;
- extern const NSFSM * const NSEnglishClickTable;
- extern const int NSEnglishClickTableSize;
-
- extern const unsigned char * const NSCSmartLeftChars;
- extern const unsigned char * const NSCSmartRightChars;
- extern const unsigned char * const NSCCharCatTable;
- extern const NSFSM * const NSCBreakTable;
- extern const int NSCBreakTableSize;
- extern const NSFSM * const NSCClickTable;
- extern const int NSCClickTableSize;
-
- typedef int (*NSTextFunc) (id self, NSLayInfo *layInfo);
- typedef unsigned short (*NSCharFilterFunc) (
- unsigned short charCode, int flags, unsigned short charSet);
- typedef char *(*NSTextFilterFunc) (
- id self, unsigned char * insertText, int *insertLength, int position);
- #ifdef KANJI
- typedef BOOL (*NXclickFunc) ( id self, int clickPos, NSSelPt * left, NSSelPt * right ) ;
- #endif
-
- @interface NSText : NSView <NXReadOnlyTextStream, NXSelectText, NXChangeSpelling, NXIgnoreMisspelledWords>
- {
- const NSFSM *breakTable;
- const NSFSM *clickTable;
- const unsigned char *preSelSmartTable;
- const unsigned char *postSelSmartTable;
- const unsigned char *charCategoryTable;
- char delegateMethods;
- NSCharFilterFunc charFilterFunc;
- NSTextFilterFunc textFilterFunc;
- char *_compilerErrorSpacer;
- NSTextFunc scanFunc;
- NSTextFunc drawFunc;
- id delegate;
- int tag;
- DPSTimedEntry cursorTE;
- NSTextBlock *firstTextBlock;
- NSTextBlock *lastTextBlock;
- NSRunArray *theRuns;
- NSRun typingRun;
- NSBreakArray *theBreaks;
- int growLine;
- int textLength;
- float maxY;
- float maxX;
- NSRect bodyRect;
- float borderWidth;
- char clickCount;
- NSSelPt sp0;
- NSSelPt spN;
- NSSelPt anchorL;
- NSSelPt anchorR;
- float backgroundGray;
- float textGray;
- float selectionGray;
- NSSize maxSize;
- NSSize minSize;
- struct _tFlags {
- #ifdef __BIG_ENDIAN__
- unsigned int _editMode:2;
- unsigned int _selectMode:2;
- unsigned int _caretState:2;
- unsigned int changeState:1;
- unsigned int charWrap:1;
- unsigned int haveDown:1;
- unsigned int anchorIs0:1;
- unsigned int horizResizable:1;
- unsigned int vertResizable:1;
- unsigned int overstrikeDiacriticals:1;
- unsigned int monoFont:1;
- unsigned int disableFontPanel:1;
- unsigned int inClipView:1;
- #else
- unsigned int inClipView:1;
- unsigned int disableFontPanel:1;
- unsigned int monoFont:1;
- unsigned int overstrikeDiacriticals:1;
- unsigned int vertResizable:1;
- unsigned int horizResizable:1;
- unsigned int anchorIs0:1;
- unsigned int haveDown:1;
- unsigned int charWrap:1;
- unsigned int changeState:1;
- unsigned int _caretState:2;
- unsigned int _selectMode:2;
- unsigned int _editMode:2;
- #endif
- } tFlags;
- void *_info;
- NXStream *textStream;
- unsigned int _reservedText1;
- unsigned int _reservedText2;
- }
-
- + initialize;
- + excludeFromServicesMenu:(BOOL)flag;
- + getDefaultFont;
- + setDefaultFont:anObject;
-
- - initFrame:(NSRect)frameRect text:(NSString *)theText alignment:(NSTextAlignment)mode;
- - initFrame:(NSRect)frameRect;
- - (void)dealloc;
- - renewRuns:(NSRunArray *)newRuns text:(NSString *)newText frame:(NSRect)newFrame tag:(int)newTag;
- - renewFont:newFontId text:(NSString *)newText frame:(NSRect)newFrame tag:(int)newTag;
- - renewFont:(NSString *)newFontName size:(float)newFontSize style:(int)newFontStyle text:(NSString *)newText frame:(NSRect)newFrame tag:(int)newTag;
- - setEditable:(BOOL)flag;
- - (BOOL)isEditable;
- - adjustPageHeightNew:(float *)newBottom top:(float)oldTop bottom:(float)oldBottom limit:(float)bottomLimit;
- - (NSRect)paragraphRect:(int)prNumber start:(int *)startPos end:(int *)endPos;
- - (int)textLength;
- - (int)byteLength;
- - (int)getSubstring:(char *)buf start:(int)startPos length:(int)numChars;
- - setText:(NSString *)aString;
- - readText:(NXStream *)stream;
- - readRichText:(NXStream *)stream;
- - writeText:(NXStream *)stream;
- - writeRichText:(NXStream *)stream;
- - writeRichText:(NXStream *)stream from:(int)start to:(int)end;
- - setCharFilter:(NSCharFilterFunc)aFunc;
- - (NSCharFilterFunc)charFilter;
- - setTextFilter:(NSTextFilterFunc)aFunc;
- - (NSTextFilterFunc)textFilter;
- - (const unsigned char *)preSelSmartTable;
- - setPreSelSmartTable:(const unsigned char *)aTable;
- - (const unsigned char *)postSelSmartTable;
- - setPostSelSmartTable:(const unsigned char *)aTable;
- - (const unsigned char *)charCategoryTable;
- - setCharCategoryTable:(const unsigned char *)aTable;
- - (const NSFSM *)breakTable;
- - setBreakTable:(const NSFSM *)aTable;
- - (const NSFSM *)clickTable;
- - setClickTable:(const NSFSM *)aTable;
- - setTag:(int)anInt;
- - (int)tag;
- - setDelegate:anObject;
- - delegate;
- - setBackgroundGray:(float)value;
- - (float)backgroundGray;
- - setBackgroundColor:(NXColor)color;
- - (NXColor)backgroundColor;
- - setTextGray:(float)value;
- - setTextColor:(NXColor)color;
- - (float)textGray;
- - (NXColor)textColor;
- - (float)selGray;
- - (float)runGray: (NSRun *)run;
- - (NXColor)runColor: (NSRun *)run;
- - (NXColor)selColor;
- - windowChanged:newWindow;
- - (NXStream *)stream;
- - write:(NXTypedStream *)stream;
- - read:(NXTypedStream *)stream;
- - readRichText:(NXStream *)stream atPosition:(int)position;
- - finishReadingRichText;
- - startReadingRichText;
- - setRetainedWhileDrawing:(BOOL)aFlag;
- - (BOOL) isRetainedWhileDrawing;
- #ifndef KANJI
- - (NSTextBlock *)firstTextBlock;
- - setScanFunc:(NSTextFunc)aFunc;
- - (NSTextFunc)scanFunc;
- - setDrawFunc:(NSTextFunc)aFunc;
- - (NSTextFunc)drawFunc;
- #endif
-
- - (int)offsetFromPosition: (int)charPos;
- - (int)positionFromOffset:(int)offset;
- - (int)charLength;
-
- #ifdef KANJI
- - setClickFunc: (NXclickFunc) clickFunc ;
- - (NXclickFunc) clickFunc ;
- - (NXStream *) wstream ;
- - disableStream ;
- #endif
-
- /*
- * These methods are now obsolete. The NeXTstep encoding supports diacritical
- * marks directly (and these methods were never implemented anyway).
- */
- - setOverstrikeDiacriticals:(BOOL)flag;
- - (int)overstrikeDiacriticals;
-
- /*
- * This method is now obsolete.
- * Use writeRichText: and writeRichText:from:to:.
- */
- - writeRichText:(NXStream *)stream forRun:(NSRun *)run atPosition:(int)runPosition emitDefaultRichText:(BOOL *)writeDefaultRTF;
-
- @end
-
- @interface NSText(FrameRect)
- - (NSSize)maxSize;
- - (NSSize)minSize;
- - (BOOL)isHorizResizable;
- - (BOOL)isVertResizable;
- - setFrameOrigin:(NSPoint)_newOrigin;
- - resizeText:(NSRect)oldBounds :(NSRect)maxRect;
- - setMaxSize:(NSSize)newMaxSize;
- - setMinSize:(NSSize)newMinSize;
- - setHorizResizable:(BOOL)flag;
- - setVertResizable:(BOOL)flag;
- - setFrameSize:(NSSize)_newSize;
- - sizeToFit;
- @end
-
- @interface NSText(Layout)
- - (NSTextAlignment)alignment;
- - (int)calcLine;
- - (void *)calcParagraphStyle:fontId:(int)alignment;
- - (BOOL)charWrap;
- - (float)descentLine;
- - getMarginLeft:(float *)leftMargin right:(float *)rightMargin top:(float *)topMargin bottom:(float *)bottomMargin;
- - getMinWidth:(float *)width minHeight:(float *)height maxWidth:(float)widthMax maxHeight:(float)heightMax;
- - (void *)defaultParaStyle;
- - (float)lineHeight;
- - setAlignment:(NSTextAlignment)mode;
- - setCharWrap:(BOOL)flag;
- - setDescentLine:(float)value;
- - setLineHeight:(float)value;
- - setMarginLeft:(float)leftMargin right:(float)rightMargin top:(float)topMargin bottom:(float)bottomMargin;
- - setNoWrap;
- - setParaStyle:(void *)paraStyle;
- @end
-
- @interface NSText(LinePosition)
- - (int)lineFromPosition:(int)position;
- - (int)positionFromLine:(int)line;
- @end
-
- @interface NSText(Drawing)
- - drawRect:(NSRect)rect;
- @end
-
- @interface NSText(Event)
- - (BOOL)acceptsFirstResponder;
- - becomeFirstResponder;
- - becomeKeyWindow;
- - clear:sender;
- - copy:sender;
- - cut:sender;
- - delete:sender;
- - keyDown:(NXEvent *)theEvent;
- - mouseDown:(NXEvent *)theEvent;
- - moveCaret:(unsigned short)theKey;
- - paste:sender;
- - pasteRuler:sender;
- - pasteFont:sender;
- - resignFirstResponder;
- - resignKeyWindow;
- - selectAll:sender;
- - selectText:sender;
- - copyRuler:sender;
- - copyFont:sender;
- @end
-
- @interface NSText(Ruler)
- - toggleRuler:sender;
- -(BOOL)isRulerVisible;
- @end
-
- @interface NSText(Selection)
- - getSel:(NSSelPt *)start :(NSSelPt *)end;
- - hideCaret;
- - (BOOL)isSelectable;
- - replaceSel:(NSString *)aString;
- - replaceSel:(NSString *)aString length:(int)length;
- - replaceSel:(NSString *)aString length:(int)length runs:(NSRunArray *)insertRuns;
- - replaceSelWithRichText:(NXStream *)stream;
- - scrollSelToVisible;
- - selectError;
- - selectNull;
- - setSel:(int)start :(int)end;
- - setSelectable:(BOOL)flag;
- - setSelGray:(float)value;
- - setSelColor:(NXColor) color;
- - showCaret;
- - subscript:sender;
- - superscript:sender;
- - underline:sender;
- - unscript:sender;
- - validRequestorForSendType:(NSString *)sendType andReturnType:(NSString *)returnType;
- - readSelectionFromPasteboard:pboard;
- - (BOOL)writeSelectionToPasteboard:pboard types:(NSArray *)types;
- @end
-
- @interface NSText(NSFont)
- - changeFont:sender;
- - font;
- - (BOOL)isFontPanelEnabled;
- - (BOOL)isMonoFont;
- - setFont:fontObj;
- - setFont:fontObj paraStyle:(void *)paraStyle;
- - setSelFontFamily:(NSString *)fontName;
- - setSelFontSize:(float)size;
- - setSelFontStyle:(NSFontTraitMask)traits;
- - setSelFont:fontId;
- - setSelFont:fontId paraStyle:(void *)paraStyle;
- - setFontPanelEnabled:(BOOL)flag;
- - setMonoFont:(BOOL)flag;
- - changeTabStopAt:(float)oldX to:(float)newX;
- - setSelProp:(NSParagraphProperty)prop to:(float)val;
- - alignSelLeft:sender;
- - alignSelRight:sender;
- - alignSelCenter:sender;
- @end
-
- @interface NSText(SpellChecking)
- - showGuessPanel:sender;
- - checkSpelling:sender;
- @end
-
- @interface NSText(Graphics)
- - replaceSelWithCell:cell;
- - replaceSelWithView:view;
- - (NSPoint)locationOfCell:cell;
- - setLocation:(NSPoint)origin ofCell:cell;
- - (NSPoint)locationOfView:view;
- + registerDirective:(NSString *)directive forClass:class;
- @end
-
- @interface NSText(Find)
- - (BOOL)findText:(NSString *)textPattern ignoreCase:(BOOL) ignoreCase backwards:(BOOL) backwards wrap:(BOOL) wrap;
- @end
-
- @interface NSText (RTFD)
- - (NSRTFDError)saveRTFDTo:(NSString *)path removeBackup:(BOOL)removeBackup errorHandler:errorHandler;
- - (NSRTFDError)openRTFDFrom:(NSString *)path;
- - writeRTFDTo:(NXStream *)stream;
- - readRTFDFrom:(NXStream *)stream;
- - writeRTFDSelectionTo:(NXStream *)stream;
- - replaceSelWithRTFD:(NXStream *)stream;
- - setGraphicsImportEnabled:(BOOL) flag;
- - (BOOL) isGraphicsImportEnabled;
-
- @end
-
- @interface NSObject(TextDelegate)
- - textWillResize:textObject;
- - (NSRect)textDidResize:textObject oldBounds:(NSRect)oldBounds;
- - (BOOL)textWillChange:textObject;
- - textDidChange:textObject;
- - (BOOL)textWillEnd:textObject;
- - textDidEnd:textObject endChar:(unsigned short)whyEnd;
- - textDidGetKeys:textObject isEmpty:(BOOL)flag;
- - textWillSetSel:textObject toFont:font;
- - textWillConvert:textObject fromFont:from toFont:to;
- - textWillStartReadingRichText:textObject;
- - textWillFinishReadingRichText:textObject;
- - (NSSize)textWillWrite:textObject;
- - textDidRead:textObject paperSize:(NSSize)paperSize;
-
- /* The following delegate methods are obsolete and should not be used. */
-
- - textWillWriteRichText:textObject stream:(NXStream *)stream forRun:(NSRun *)run atPosition:(int)runPosition emitDefaultRichText:(BOOL *)writeDefaultRichText;
- - textWillReadRichText:textObject stream:(NXStream *)stream atPosition:(int)runPosition;
- - textPath:(char *)path forText:textObject maxLength:(int)maxLength;
-
- @end
-
- @interface NSObject(TextCell)
- /*
- * Any object added to the Text object via replaceSelWithCell: must
- * respond to all of the following messages:
- */
- - highlight:(NSRect)cellFrame inView:controlView lit:(BOOL)flag;
- - drawSelf:(NSRect)cellFrame inView:controlView;
- - (BOOL)trackMouse:(NXEvent *)theEvent inRect:(NSRect)cellFrame ofView:controlView untilMouseUp:(BOOL)untilMouseUp;
- - (NSSize)cellSize;
- - readRichText:(NXStream *)stream forView:view;
- - writeRichText:(NXStream *)stream forView:view;
- @end
-
-
- extern void NSTextFontInfo(
- id fid, float *ascender, float *descender, float *lineHt);
- extern int NSScanALine(id self, NSLayInfo *layInfo);
- extern int NSDrawALine(id self, NSLayInfo *layInfo);
- extern unsigned short NSFieldFilter(
- unsigned short theChar, int flags, unsigned short charSet);
- extern unsigned short NSEditorFilter(
- unsigned short theChar, int flags, unsigned short charSet);
- extern void NSSetTextCache(id self, NSTextCache *cache, int pos);
- extern int NSAdjustTextCache(id self, NSTextCache *cache, int pos);
- extern void NSFlushTextCache(id self, NSTextCache *cache);
- extern void NXWriteWordTable(NXStream *st, const unsigned char *smartLeft,
- const unsigned char *smartRight,
- const unsigned char *charClasses,
- const NSFSM *wrapBreaks, int wrapBreaksCount,
- const NSFSM *clickBreaks, int clickBreaksCount, BOOL charWrap);
- extern void NSReadWordTable(NSZone *zone, NXStream *st,
- unsigned char **smartLeft, unsigned char **smartRight,
- unsigned char **charClasses,
- NSFSM **wrapBreaks, int *wrapBreaksCount,
- NSFSM **clickBreaks, int *clickBreaksCount,
- BOOL *charWrap);
- #ifdef KANJI
- extern BOOL NSClick ( id self, int clickPos, NSSelPt * left, NSSelPt * right );
- #endif
-
- typedef struct {
- unsigned char primary[256];
- unsigned char secondary[256];
- unsigned char primaryCI[256];
- unsigned char secondaryCI[256];
- } NXStringOrderTable;
-
- extern int NSOrderStrings(const unsigned char *s1, const unsigned char *s2, BOOL caseSensitive, int length, NXStringOrderTable *table);
- extern NXStringOrderTable *NSDefaultStringOrderTable(void);
-
- #endif TEXT_H
-
-